﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace UI.Forms
{
    public partial class CRM_ClientSource_N : FormBase1
    {
        public delegate void DoAction(string name);//如果有参数的话，定义参数 

        public DoAction FatherRefresh;
        public CRM_ClientSource_N()
        {
            InitializeComponent();
        }

        private void CRM_ClientSource_Load(object sender, EventArgs e)
        {
            
        }

        private void btn_new_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (dxValidationProvider1.Validate())
            {
                SVC.client.CRM_ClientSource cs = new SVC.client.CRM_ClientSource();
                cs.SourceName = te_SourceName.Text.Trim();
                string r = my.bw.CRM_ClientSource_Add(cs, my.ACID);
                if (string.IsNullOrEmpty(r))
                {
                    FatherRefresh(te_SourceName.Text.Trim());
                    this.Close();
                }
                else
                {
                    Comm.ShowErorr(r);
                }
            }
        }
    }
}